package com.mright.step01.api;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.config.ServiceConfig;
import com.mright.step01.xml.impl.EchoApiImpl;

import java.io.IOException;

/**
 * @author zhaochuanzhen
 * @since 2022/2/10 11:52 下午
 */
public class EchoProvider {

    public static void main(String[] args) throws IOException {
        ServiceConfig<EchoApi> serviceConfig = new ServiceConfig<>();
        serviceConfig.setApplication(new ApplicationConfig("echo_api_provider"));
        serviceConfig.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
        serviceConfig.setInterface(EchoApi.class);
        serviceConfig.setRef(new EchoApiImpl());
        serviceConfig.export();

        System.in.read();
    }
}
